package com.gopay.common.constants.rcs;


/**
 * 交易资金方向
 * @TranDirection.java
 * @author liujy
 * @2013-7-26 下午1:48:19  www.gopay.com.cn Inc.All rights reserved.
 */
public enum TranDirection {
    
    /**  01 - from C Bank  来自个人银行 */
    FROM_C_BANK("01"),
    /** 02 - from B Bank  来自企业银行 */
    FROM_B_BANK("02"),
    /** 03 - to C Bank    往个人银行  */
    TO_C_BANK("03"),
    /** 04 - to B Bank */
    TO_B_BANK("04"),
    /** 05 - from C Account 来自个人国付宝账户 */
    FROM_C_ACCOUNT("05"),
    /** 06 - from B Account */
    FROM_B_ACCOUNT("06"),
    /** 07 - to C Account 往个人国付宝账户 */
    TO_C_ACCOUNT("07"),
    /** 08 - to B Account  */
    TO_B_ACCOUNT("08"),
    /** 09 - from All */
    FROM_ALL("09");

    public final String value;

    private TranDirection(String value) {
        this.value = value;
    }

    @Override
    public String toString(){
    	return this.value;
    }
    
    public static String getNameByValue(String value){
    	 
    	TranDirection[] tranDirections = TranDirection.values();
    	for (TranDirection tranDirection : tranDirections) {
			if(value.equals(tranDirection.value)){
				return tranDirection.name();
			}
		}
    	return "未知方向";
    }
}
